//
//  ClientThreadController.h
//  Networking
//
//  This class does the networking on the client side.
//
//  Created by Christoph Eßer on 11/25/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Connection.h"
#import "NetworkMessageHandler.h"
#import "ClientMessaging.h"

@interface ClientThreadController : NSObject<NetworkMessageHandler> {
    NSThread *networkingThread;
    NSThread *mainThread;
    
    Connection *connection;
    NSString *connID;
    NSString *oldConnID;
    NSObject<ClientMessaging> *messageDelegate;
}

@property (assign) NSObject<ClientMessaging> *messageDelegate;
@property (assign) NSString *connID;
@property (assign) NSString *oldConnID;

-(NSThread*) startNetworkingThreadConnectToAddress: (NSString*) addr onPort: (NSInteger) port;
-(void) stopNetworkingThread;

-(void) sendMessageToServer: (NetworkMessage*) msg;
@end
